module.exports = {
    name: "AdminUser",
    viewName: 'ViewAdminUser',
    primaryKey: "UserId",
    properties: getProperties(),
    rightGroupsDataSources: getRightGroupsDataSources(),
    employeesDataSource:getEmployeesDataSource()
}

function getProperties() {
    return [
        getProperty("UserId", "UserId"),
        getProperty("LoginName", "登录名"),
        getProperty("UserName", "用户名"),
        getProperty("EmployeeName", "所属员工"),
        getProperty("RightGroupNames2", "权限组"),
        getProperty("LastLoginDate", "最近登录时间"),
        getProperty("CreateDate", "创建时间")
    ]
}

function getRightGroupsDataSources() {
    return {
        valueName: "RightGroupId",
        textName: "Name",
        stateName: "getRightGroups",
        serviceName: "RightGroupService",
        actionName: "getRightGroups",
        isRefresh: true
    }
}

function getEmployeesDataSource() {
    return {
        valueName: "EmployeeId",
        textName: "Name",
        stateName: "getEmployees2",
        serviceName: "EmployeeService",
        actionName: "getEmployees2",
        isRefresh: true
    }
}

function getProperty(name, label) {
    return { name, label }
}